#!/usr/bin/env python
#    prop_spinspin2
#    --------------
#    Molecule:         H2O
#    Wave Function:    MCSCF (CAS)
#    Test Purpose:     Spin-spin coupling constants calculating only the
#                      normally most dominating contributions to the
#                      isotropic and anisotropic coupling constants, namely
#                      the FC-FC and FC-SD terms, thus only solving one
#                      response equation

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

# Basis set 
f.add(from_string = 'Atoms and basis sets',
      num_lines = 15,
      rel_tolerance = 1.0e-2)

# Molecular geometry
f.add(from_string = 'Cartesian Coordinates',
      num_lines = 10,
      rel_tolerance = 1.0e-8)

# Symmetry
f.add(string = 'Number of coordinates in each symmetry',
      rel_tolerance = 1.0e-2)
f.add(string = 'Number of orbitals in each symmetry',
      rel_tolerance = 1.0e-2)

# Energies
f.add(string = 'Hartree-Fock total energy',
      rel_tolerance = 1.0e-9)
f.add(string = 'MP2 second order energy',
      rel_tolerance = 1.0e-9)
f.add(string = 'Final MCSCF energy:',
      rel_tolerance = 1.0e-9)

f.add(from_string = 'Isotropic coupling',
      num_lines = 10,
      abs_tolerance = 1.0e-4)

test.run(['prop_spinspin2.dal'], ['H2O_intgrl_sym.mol'], f={'out': f},
         accepted_errors=['not implemented for parallel calculations.'])

sys.exit(test.return_code)
